package com.xigua.threadSafe;

/**
 * @author LiRongHua
 * @Title: ${file_name}
 * @Package ${package_name}
 * @Description: ${todo}
 * @date 2021/12/2422:45
 */
public class Demo {
    public static void main(String[] args) {
//        Ticket ticket = new Ticket();
//        long start = System.currentTimeMillis();
//        Thread ticket1 = new Thread(ticket,"窗口一");
//        Thread ticket2 = new Thread(ticket,"窗口二");
//        Thread ticket3 = new Thread(ticket,"窗口三");
//        ticket1.start();
//        ticket2.start();
//        ticket3.start();


//        TicketMethod ticketMethod = new TicketMethod();
//
//        Thread t1 = new Thread(ticketMethod,"窗口一");
//        Thread t2 = new Thread(ticketMethod,"窗口二");
//        Thread t3 = new Thread(ticketMethod,"窗口三");
//
//        t1.start();
//        t2.start();
//        t3.start();

        LockTicket lockTicket = new LockTicket();

        Thread t1 = new Thread(lockTicket,"窗口一");
        Thread t2 = new Thread(lockTicket,"窗口二");
        Thread t3 = new Thread(lockTicket,"窗口三");
        t1.start();
        t2.start();
        t3.start();
    }
}
